//
//  BackButton.m
//  aiteshangcheng
//
//  Created by 艾特—iOS on 12/4/18.
//  Copyright © 2018年 aite. All rights reserved.
//

#import "BackButton.h"
@implementation BackButton

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.imageView.contentMode = UIViewContentModeLeft;
        
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:10];
        [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//        [self setTitleColor:RGBColor(0, 197, 251) forState:UIControlStateSelected];
        
    }
    return self;
}

- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    CGFloat imageX = 0;
    CGFloat imageY = (self.frame.size.height - 30)/2;

    return rect(imageX, imageY, 20, 30);
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    return rect(20, (self.frame.size.height - 30)/2, 30, 30);
}
@end
